/**  
 * Copyright (c) 2010 University of Pennsylvania.
 *     All rights reserved.
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an "AS
 *  IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 *  express or implied.  See the License for the specific language
 *  governing permissions and limitations under the License.
 *
 */
 
struct {
#ifdef TOSSIM

#define MAX_FAILNODES         15
#define MAX_CONFIGQUERYSPEC   10

  struct {
    uint8_t buffer_len, buffer[256];
  } PACKING_MACRO query_spec[MAX_CONFIGQUERYSPEC];
  uint8_t queryspec_count;

  uint32_t fail_time;  // if positive, cycles after which the node is considered to be failed
  struct {
    ADDRESS node;
    uint16_t time;
  } PACKING_MACRO fail_nodes[MAX_FAILNODES];
  uint8_t fail_count;

  char tree_dir[256], value_dir[256], join_dir[256], sample_dir[256], route_dir[256];
#endif

  uint8_t load_trees, trees_enabled, start_route, start_join, route_method; // 0 - seq. route, 1 - flood
  uint16_t node_count, retry_count;
  uint8_t disable_msglog, pause;   // what to do in pause - quit/continue/ask
  uint8_t enable_send, confirm_drop; // do not send data values despite query, confirm dropped messages
  uint8_t merge_paths;  // multi path optimization options
  uint8_t repair_level;  //(0 - basic, 1 - RepairRoute with regular ID BF, 2 - ID BF + neighbors
  uint8_t defaultquery_options;
} PACKING_MACRO config;

void init_mconfig();

#ifdef TOSSIM
void read_config();
#endif
